package com.ysx.yapiexample.controller;

import com.ysx.yapiclientsdk.modal.User;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/name")
public class NameController {
    @GetMapping("/get")
    public String getNameByGet(String name) {
        return "GET Request Your name is " + name;
    }

    @PostMapping("/post")
    public String getNameByPost(String name) {
        return "POST Request Your name is " + name;
    }

    @PostMapping("/user")
    public String getNameByPostJson(@RequestBody User user) {
        return "POST JSON Request Your name is " + user.getUsername();
    }
}
